package chat.mp3s.mcp.config;

import org.springframework.ai.tool.ToolCallbackProvider;
import org.springframework.ai.tool.method.MethodToolCallbackProvider;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import chat.mp3s.mcp.service.DBTableStructureService;
import chat.mp3s.mcp.service.DBViewMapperService;
import chat.mp3s.mcp.service.NumService;
import chat.mp3s.mcp.service.OpenMeteoService;
import chat.mp3s.mcp.service.WeatherService;

@Configuration
public class ToolCallbackProviderRegister {

    @Bean
    public ToolCallbackProvider weatherTools(WeatherService weatherService) {
        return MethodToolCallbackProvider.builder().toolObjects(weatherService).build();
    }

    @Bean
    public ToolCallbackProvider numTools(NumService numService) {
        return MethodToolCallbackProvider.builder().toolObjects(numService).build();
    }

    @Bean
    public ToolCallbackProvider openMeteoTools(OpenMeteoService openMeteoService) {
        return MethodToolCallbackProvider.builder().toolObjects(openMeteoService).build();
    }

    @Bean
    public ToolCallbackProvider dbStructTools(DBTableStructureService dbStructService) {
        return MethodToolCallbackProvider.builder().toolObjects(dbStructService).build();
    }

    @Bean
    public ToolCallbackProvider dbViewTools(DBViewMapperService dbViewService) {
        return MethodToolCallbackProvider.builder().toolObjects(dbViewService).build();
    }
}
